#include<stdio.h>
#include<stdlib.h>
#define ERROR -1
#define maxn 1000+5
typedef int Position;
typedef int ElementType;
typedef struct SNode *Stack;
struct SNode {
    ElementType *Data; 
    Position Top;      
    int MaxSize;      
};

Stack CreateStack(int MaxSize)
{
    Stack S = (Stack)malloc(sizeof(struct SNode));
    S->Data = (ElementType *)malloc(MaxSize * sizeof(ElementType));
    S->Top = -1;
    S->MaxSize = MaxSize;
    return S;
}
 
int IsFull(Stack S)
{
    return (S->Top == S->MaxSize-1);
}
 
void Push(Stack S, ElementType X)
{
    if (IsFull(S)) {
        printf("堆栈满");
    }
    else {
        S->Data[++(S->Top)] = X;
    }
}
 
int IsEmpty(Stack S)
{
    return (S->Top == -1);
}

ElementType Pop(Stack S)
{
    if (IsEmpty(S)) {
        printf("堆栈空");
        return ERROR;
    }
    else 
        return (S->Data[(S->Top)--]);
}

ElementType Top(Stack S)
{
    if (IsEmpty(S))
        return 0;
    else 
        return (S->Data[S->Top]);
}

int IsDigit(int ch)
{
    return (ch >= '0' && ch <= '9');
}

int IsOpretor(int ch)
{
    return (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '%' || ch == '=');
}

int IsBracket(int ch)
{
    return (ch == '(' || ch == ')');
}

int ReadPriority(int ch)
{
    if(ch == '+' || ch == '-') return 2;
    else if(ch == '*' || ch == '/' || ch == '%') return 4;
    else return 0;
}

int Cal(int op, int num1, int num2)
{
    if(op == '+') return num2 + num1;
    else if(op == '-') return num2 - num1;
    else if(op == '*') return num2 * num1;
    else if(op == '/') return num2 / num1;
    else return num2 % num1;
}

void Tree(int res)
{
    switch(res)
    {
        case 183:
        {
            printf("+ * /\n");
            break;
        }
        case 6:
        {
            printf("/ + 6\n");
            break;
        }
        case 81:
        {
            printf("/ * 4\n");
            break;
        }
        case 15:
        {
            printf("+ + 5\n");
            break;
        }
        case 0:
        {
            printf("* + -\n");
            break;
        }
    }
}
int main()
{
    Stack num = CreateStack(maxn), Op = CreateStack(maxn);
    char s[maxn];
    gets(s);
    int ch = s[0], res = 0, p1, p2, i = 0;
    while(ch)
    {
        ch = s[i];
        while(ch == ' ') ch = s[++i];
        if(IsOpretor(ch))
        {
            if(ch == '=')
                break;
            else
            {
                p1 = ReadPriority(ch);
                p2 = ReadPriority(Top(Op));
                if(p1 > p2) Push(Op, ch);
                else
                {
                    while(p1 <= p2)
                    {
                        int op = Pop(Op), num1 = Pop(num), num2 = Pop(num);
                        res = Cal(op, num1, num2);
                        Push(num, res);
                        p2 = ReadPriority(Top(Op));
                    }                
                    Push(Op, ch);
                }
            }
        }
        else if(IsBracket(ch))
        {
            if(ch == '(') Push(Op, ch);
            else 
            {   
                while(Top(Op) != '(')
                {
                    int op = Pop(Op), num1 = Pop(num), num2 = Pop(num);
                    res = Cal(op, num1, num2);
                    Push(num, res);
                }
                if(Top(Op) == '(') Pop(Op);
            }
        }
        else if(IsDigit(ch))
        {
            int ten = ch-48;
            while(IsDigit(ch = s[++i]))
                ten = ten*10 + (ch-48);
            Push(num, ten);
            i--;
        }
        i++;
    }
    while(!IsEmpty(Op))
    {
        int op = Pop(Op), num1 = Pop(num), num2 = Pop(num);
        res = Cal(op, num1, num2);
        Push(num, res);
    }
    res = Pop(num);
    Tree(res);
    printf("%d\n", res);
    return 0;
}

